package com.njitzx.controller;

import com.njitzx.Result;
import com.njitzx.entity.vo.*;
import com.njitzx.serivce.StudentService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequiredArgsConstructor
public class AnalysisController {

    private final StudentService studentService;

    /**
     * 学院人数
     */
    @GetMapping("/analysis/college")
    public Result getCollege() {
        CollegeVO vo = studentService.getCollege();
        return Result.success(vo);
    }

    /**
     * 男女性别
     *
     * @return
     */

    @GetMapping("/analysis/sex")
    public Result getSex() {
        List<GenderVO> vo = studentService.getSex();
        return Result.success(vo);
    }

    @GetMapping("/analysis/province")
    public Result getProvince() {
        List<ProvinceVO> vo = studentService.getProvince();
        return Result.success(vo);
    }

    @GetMapping("/analysis/number")
    public Result getNumber() {
        NumberVO vo = studentService.getnumbwer();
        return Result.success(vo);
    }

//    @GetMapping("/analysis/name")
//    public Result getTopName(){
//
//    }

    @GetMapping("/analysis/hobby")
    public Result getStudentHobby() {
        HobbyVO vo = studentService.getHobby();
        return Result.success(vo);
    }
}
